package mju.cxf.controller.user;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import mju.cxf.result.Result;
import mju.cxf.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "商品接口列表")
@RequestMapping("/api/product")
public class IProductController {
    @Autowired
    private ProductService productService;

    /**
     * U查询商品总数
     * @return result
     */
    @GetMapping("/productCount")
    @ApiOperation(value = "商品统计数量",notes = "用户查询商品总数")
    public Result<String> getCategoriesToProducts() {
        return Result.success( productService.selectAllProductsCount());
    }
}
